<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>hsm-statechart: hsm/hsm_machine.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="hsm-statechart.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">hsm-statechart
   &#160;<span id="projectnumber">0.5</span>
   </div>
   <div id="projectbrief">An easy to use hierarchical state machine for C and C++</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('hsm__machine_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">hsm_machine.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="hsm__machine_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ae27734e5582668debb68db973903e2f9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#ae27734e5582668debb68db973903e2f9">PSEUDO_STATE</a>(Pseudo)</td></tr>
<tr class="memdesc:ae27734e5582668debb68db973903e2f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">macro for making a pseudostate:  <a href="#ae27734e5582668debb68db973903e2f9"></a><br/></td></tr>
<tr class="memitem:a7eb625feb8c90638a86b0ce39ef77a88"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#a7eb625feb8c90638a86b0ce39ef77a88">ERROR_IF_FALSE</a>(x, msg)</td></tr>
<tr class="memdesc:a7eb625feb8c90638a86b0ce39ef77a88"><td class="mdescLeft">&#160;</td><td class="mdescRight">According to the <a href="http://www.w3.org/TR/scxml/#SelectingTransitions:">http://www.w3.org/TR/scxml/#SelectingTransitions:</a> I.  <a href="#a7eb625feb8c90638a86b0ce39ef77a88"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1ba67e8e0edddad002d4f4c44d0e73db"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#a1ba67e8e0edddad002d4f4c44d0e73db">HsmTopState</a> ()</td></tr>
<tr class="memdesc:a1ba67e8e0edddad002d4f4c44d0e73db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Token state for use with the <a class="el" href="hsm__state_8h.html#a13ea60f370fd7663153ad6d7fb7c73e1" title="Macro for declaring a state.">HSM_STATE</a> macros to represent the outer most state.  <a href="#a1ba67e8e0edddad002d4f4c44d0e73db"></a><br/></td></tr>
<tr class="memitem:aa76acf4404c88430c55d971d99c60e04"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#aa76acf4404c88430c55d971d99c60e04">HsmSetInfoCallbacks</a> (<a class="el" href="hsm__info_8h.html#structhsm__info__rec">hsm_info_t</a> *info, <a class="el" href="hsm__info_8h.html#structhsm__info__rec">hsm_info_t</a> *old_callbacks)</td></tr>
<tr class="memdesc:aa76acf4404c88430c55d971d99c60e04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Install a new set of callbacks for spying on internal statemachine processing.  <a href="#aa76acf4404c88430c55d971d99c60e04"></a><br/></td></tr>
<tr class="memitem:a620a775df3ad215e489a9b487245749f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#a620a775df3ad215e489a9b487245749f">HsmMachine</a> (<a class="el" href="hsm__machine_8h.html#structhsm__machine__rec">hsm_machine_t</a> *hsm)</td></tr>
<tr class="memdesc:a620a775df3ad215e489a9b487245749f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize a statemachine to its default values.  <a href="#a620a775df3ad215e489a9b487245749f"></a><br/></td></tr>
<tr class="memitem:ac3c05a1d7215bdf5f9e4132a26dafca2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#ac3c05a1d7215bdf5f9e4132a26dafca2">HsmMachineWithContext</a> (<a class="el" href="hsm__machine_8h.html#structhsm__context__machine__rec">hsm_context_machine_t</a> *hsm, <a class="el" href="hsm__forwards_8h.html#aa0e37ff043d2dd5216cc762ca03046cb">hsm_context</a> ctx)</td></tr>
<tr class="memdesc:ac3c05a1d7215bdf5f9e4132a26dafca2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize a statemachine with a context stack to its default values.  <a href="#ac3c05a1d7215bdf5f9e4132a26dafca2"></a><br/></td></tr>
<tr class="memitem:a893207a7a8345aad604bd01a84ee9eb4"><td class="memItemLeft" align="right" valign="top">hsm_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#a893207a7a8345aad604bd01a84ee9eb4">HsmIsRunning</a> (const <a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a> hsm)</td></tr>
<tr class="memdesc:a893207a7a8345aad604bd01a84ee9eb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determine if a machine has been started, and has not reached a terminal, nor an error state.  <a href="#a893207a7a8345aad604bd01a84ee9eb4"></a><br/></td></tr>
<tr class="memitem:a3463ad5a97144c3c652b4f677644bcba"><td class="memItemLeft" align="right" valign="top">hsm_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#a3463ad5a97144c3c652b4f677644bcba">HsmIsInState</a> (const <a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a> hsm, <a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a> state)</td></tr>
<tr class="memdesc:a3463ad5a97144c3c652b4f677644bcba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Traverses the active state hierarchy to determine if hsm is possibly in the passed state.  <a href="#a3463ad5a97144c3c652b4f677644bcba"></a><br/></td></tr>
<tr class="memitem:a7117ece3956d53414f80e1a340161f8a"><td class="memItemLeft" align="right" valign="top">hsm_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#a7117ece3956d53414f80e1a340161f8a">HsmStart</a> (<a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a> hsm, <a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a> first_state)</td></tr>
<tr class="memdesc:a7117ece3956d53414f80e1a340161f8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start a machine.  <a href="#a7117ece3956d53414f80e1a340161f8a"></a><br/></td></tr>
<tr class="memitem:a2e5511e0812b7613e3d1e496908bc8d0"><td class="memItemLeft" align="right" valign="top">hsm_bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hsm__machine_8c.html#a2e5511e0812b7613e3d1e496908bc8d0">HsmSignalEvent</a> (<a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a> hsm, <a class="el" href="hsm__forwards_8h.html#ab8e8ab8d2eb97eb5cc6331d85262fb76">hsm_event</a> evt)</td></tr>
<tr class="memdesc:a2e5511e0812b7613e3d1e496908bc8d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send the passed event to the machine.  <a href="#a2e5511e0812b7613e3d1e496908bc8d0"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition in file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>
</div><hr/><h2>Macro Definition Documentation</h2>
<a class="anchor" id="ae27734e5582668debb68db973903e2f9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSEUDO_STATE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Pseudo</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>macro for making a pseudostate: </p>
<ol type="1">
<li>a function that does nothing</li>
<li>a state info function to describe that state </li>
</ol>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00033">33</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<a class="anchor" id="a7eb625feb8c90638a86b0ce39ef77a88"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ERROR_IF_FALSE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">msg&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>According to the <a href="http://www.w3.org/TR/scxml/#SelectingTransitions:">http://www.w3.org/TR/scxml/#SelectingTransitions:</a> I. </p>
<p>""" The behavior of a transition with 'type' of "external" (the default) is defined in terms of the transition's source state (which is the state that contains the transition), the transition's target state(or states), and the Least Common Compound Ancestor (LCCA) of the source and target states When a transition is taken, the state machine will exit all active states that are proper descendants of the LCCA, starting with the innermost one(s) and working up to the immediate descendant(s) of the LCCA.</p>
<p>Then the state machine enters the target state(s), plus any states that are between it and the LCCA, starting with the outermost one (i.e., the immediate descendant of the LCCA) and working down to the target state(s).</p>
<p>As states are exited, their onexit handlers are executed. Then the executable content in the transition is executed, followed by the onentry handlers of the states that are entered. If the target state(s) of the transition is not atomic, the state machine will enter their default initial states recursively until it reaches an atomic state(s).</p>
<p>Note that the LCCA is neither entered nor exited."""</p>
<p>II. When target is a descendant of source.... "an internal transition will not exit and re-enter its source state, while an external one will."</p>
<p>III. """ [For] a transition whose target is its source state.... the state is exited and reentered, 
     triggering execution of its onentry and onexit executable content.""" </p>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00367">367</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a1ba67e8e0edddad002d4f4c44d0e73db"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a> HsmTopState </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Token state for use with the <a class="el" href="hsm__state_8h.html#a13ea60f370fd7663153ad6d7fb7c73e1" title="Macro for declaring a state.">HSM_STATE</a> macros to represent the outer most state. </p>
<dl class="section return"><dt>Returns:</dt><dd>The globally shared top most state token. </dd></dl>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00050">50</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<a class="anchor" id="aa76acf4404c88430c55d971d99c60e04"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HsmSetInfoCallbacks </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__info_8h.html#structhsm__info__rec">hsm_info_t</a> *&#160;</td>
          <td class="paramname"><em>callbacks</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="hsm__info_8h.html#structhsm__info__rec">hsm_info_t</a> *&#160;</td>
          <td class="paramname"><em>old_callbacks</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Install a new set of callbacks for spying on internal statemachine processing. </p>
<p>Currently there's just one set of callbacks for all threads; this is not locked or synchronized in anyway.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">callbacks</td><td>The set of callbacks; individual callbacks can be NULL, as can the callbacks pointer itself. </td></tr>
    <tr><td class="paramname">old_callbacks</td><td>The last set of callbacks passed to HsmSetInfoCallbacks. Its recommended that you should record, and later restore the old callbacks. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00106">106</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<a class="anchor" id="a620a775df3ad215e489a9b487245749f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a> HsmMachine </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="hsm__machine_8h.html#structhsm__machine__rec">hsm_machine_rec</a> *&#160;</td>
          <td class="paramname"><em>machine</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize a statemachine to its default values. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">machine</td><td><a class="el" href="hsm__machine_8h.html#structhsm__machine__rec" title="The statemachine object.">hsm_machine_rec</a> to initialize.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc" title="Pointer to an hsm_machine_rec.">hsm_machine</a> pointer </dd></dl>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00115">115</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<a class="anchor" id="ac3c05a1d7215bdf5f9e4132a26dafca2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a> HsmMachineWithContext </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="hsm__machine_8h.html#structhsm__context__machine__rec">hsm_context_machine_rec</a> *&#160;</td>
          <td class="paramname"><em>machine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="hsm__forwards_8h.html#aa0e37ff043d2dd5216cc762ca03046cb">hsm_context</a>&#160;</td>
          <td class="paramname"><em>ctx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize a statemachine with a context stack to its default values. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">machine</td><td><a class="el" href="hsm__machine_8h.html#structhsm__context__machine__rec" title="Extends hsm_machine_rec with a context stack to provide per-state instance data.">hsm_context_machine_rec</a> to initialize. </td></tr>
    <tr><td class="paramname">ctx</td><td>Optional context for the entire machine.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc" title="Pointer to an hsm_machine_rec.">hsm_machine</a> pointer </dd></dl>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00126">126</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<a class="anchor" id="a893207a7a8345aad604bd01a84ee9eb4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hsm_bool HsmIsRunning </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>&#160;</td>
          <td class="paramname"><em>hsm</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Determine if a machine has been started, and has not reached a terminal, nor an error state. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">hsm</td><td><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc" title="Pointer to an hsm_machine_rec.">hsm_machine</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd><a class="el" href="hsm__types_8h.html#ae231908aca4879403ae108cf0f5c7a9c" title="1">HSM_TRUE</a> if running </dd></dl>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00140">140</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<a class="anchor" id="a3463ad5a97144c3c652b4f677644bcba"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hsm_bool HsmIsInState </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>&#160;</td>
          <td class="paramname"><em>hsm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a>&#160;</td>
          <td class="paramname"><em>state</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Traverses the active state hierarchy to determine if hsm is possibly in the passed state. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">hsm</td><td><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc" title="Pointer to an hsm_machine_rec.">hsm_machine</a> </td></tr>
    <tr><td class="paramname">state</td><td><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030" title="Pointer to an hsm_state_rec.">hsm_state</a> </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00147">147</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<a class="anchor" id="a7117ece3956d53414f80e1a340161f8a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hsm_bool HsmStart </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>&#160;</td>
          <td class="paramname"><em>hsm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="hsm__forwards_8h.html#aaf8612f2e29f91153ebf2c076aa68030">hsm_state</a>&#160;</td>
          <td class="paramname"><em>state</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start a machine. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">hsm</td><td>The <a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc" title="Pointer to an hsm_machine_rec.">hsm_machine</a> to start. </td></tr>
    <tr><td class="paramname">state</td><td>The first state to move to. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd><a class="el" href="hsm__types_8h.html#a661d07d1e0324624dd94942951801df4" title="0">HSM_FALSE</a> on error ( ex. the machine was already started ) </dd></dl>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00162">162</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
<a class="anchor" id="a2e5511e0812b7613e3d1e496908bc8d0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hsm_bool HsmSignalEvent </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc">hsm_machine</a>&#160;</td>
          <td class="paramname"><em>hsm</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="hsm__forwards_8h.html#ab8e8ab8d2eb97eb5cc6331d85262fb76">hsm_event</a>&#160;</td>
          <td class="paramname"><em>evt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send the passed event to the machine. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">hsm</td><td>The <a class="el" href="hsm__forwards_8h.html#a9d4b46508b6a2ff6aa734d3b6a3c24fc" title="Pointer to an hsm_machine_rec.">hsm_machine</a> targeted. </td></tr>
    <tr><td class="paramname">evt</td><td>A user defined event.</td></tr>
  </table>
  </dd>
</dl>
<p>The system will launch actions, trigger transitions, etc. </p>
<dl class="section return"><dt>Returns:</dt><dd><a class="el" href="hsm__types_8h.html#ae231908aca4879403ae108cf0f5c7a9c" title="1">HSM_TRUE</a> if handled </dd></dl>

<p>Definition at line <a class="el" href="hsm__machine_8c_source.html#l00183">183</a> of file <a class="el" href="hsm__machine_8c_source.html">hsm_machine.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_6c36b64852547327283732128225c9d7.html">hsm</a></li><li class="navelem"><a class="el" href="hsm__machine_8c.html">hsm_machine.c</a></li>
    <li class="footer">Generated on Sat Jul 7 2012 22:48:11 for hsm-statechart by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.1 </li>
  </ul>
</div>
</body>
</html>
